import request from '@/utils/request'

// 查询公交司机列表
export function listDriver(query) {
    return request({
        url: '/bus/driver/list',
        method: 'get',
        params: query
    })
}

// 查询公交司机详细
export function getDriver(id) {
    return request({
        url: '/bus/driver/' + id,
        method: 'get'
    })
}

// 新增公交司机
export function addDriver(data) {
    return request({
        url: '/bus/driver',
        method: 'post',
        data: data
    })
}

// 修改公交司机
export function updateDriver(data) {
    return request({
        url: '/bus/driver',
        method: 'put',
        data: data
    })
}

// 删除公交司机
export function delDriver(id) {
    return request({
        url: '/bus/driver/' + id,
        method: 'delete'
    })
}

// 修改状态
export function changeDriverStatus(data) {
  return request({
    url: '/bus/driver/changeStatus',
    method: 'post',
    data: data
  })
}

// 获取弹窗select数据
export function getSelectData() {
    return request({
        url: '/bus/driver/selectData',
        method: 'post',
    })
}
// 获取弹窗select数据
export function getBusNo(busNo) {
    return request({
        url: '/bus/vehicle/getBusNo/'+busNo,
        method: 'get',
    })
}